<template>
  <div>
    <div>{{ title }}</div>
  </div>
</template>

<script>
export default {
  props: {
    row: {
      type: Object,
      required: true
    }
  },
  computed: {
    title() {
      const title = this.row.title.replace(/<\/?.+?>/g, '').substring(0, 50);
      if (title === '') {
        const imgReg = /<img.*?(?:>|\/>)/gi;
        if (imgReg.test(this.row.title)) {
          return '图片试题'
        }
      }

      return title;
    }
  }
};
</script>

<style></style>
